package i2.application.fmw.cerbere.selenium.pages;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CerbereErrorPage {

	private static final Logger LOGGER = LoggerFactory.getLogger(CerbereErrorPage.class);
	
	protected WebDriver driver;
	
//	@FindBy(xpath="//a[@href='deconnexion.action']")
	@FindBy(xpath="//a[text()='Continuer']")
	private WebElement continuer;	

	
	public CerbereErrorPage(WebDriver driver) {
		this.driver = driver;
	}
	
	public void open(String url) {
		driver.get(url);
	}

	public void close() {
		driver.quit();
	}
	
	public String getTitle() {
		return driver.getTitle();
	}

	public void continuer() {
		LOGGER.debug("début continuer()");
		continuer.click();
	}

}